package com.cy.ppj.dao.mapper.order;

import com.cy.ppj.model.query.order.OrderWithholdAdminQuery;
import com.cy.ppj.model.vo.admin.order.OrderWithholdAdminStatisticsVO;
import com.cy.ppj.model.vo.admin.order.OrderWithholdAdminVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.cy.ppj.model.domian.order.OrderWithhold;

import tk.mybatis.mapper.common.BaseMapper;

import java.util.List;

/**
 * 订单代扣
 * @author: tanyilin
 * @create: 2018年7月20日 下午9:16:12
 */
@Mapper
public interface OrderWithholdMapper extends BaseMapper<OrderWithhold>{

	/**
	 * 根据 orderId 更新订单代扣信息
	 * @param orderWithhold
	 */
	void updateByOrderId(OrderWithhold orderWithhold);

	/**
	 * 根据订单id查询相应代扣点数
	 * @param orderId
	 * @return
	 */
	OrderWithhold queryByOrderId(@Param("orderId") Long orderId);

	int selectOrderWithholdAdminCount(OrderWithholdAdminQuery query);

	/**
	 * 代扣查询
	 * @param query
	 * @return
	 */
	List<OrderWithholdAdminVO> selectOrderWithholdAdminList(OrderWithholdAdminQuery query);

	/**
	 * 后台代扣统计
	 * @return
	 */
	List<OrderWithholdAdminStatisticsVO> selectOrderWithholdAdminStatistics();
}
